package com.openlogic.api.logic.entity;


import java.util.List;

import org.noear.solon.validation.annotation.NotNull;

import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import com.openlogic.common.core.web.domain.BaseEntity;

/**
* @ClassName: RuleModelFact
* @Description: 规则变量实体
* @author weiyongpeng
* @date 2024年7月16日 上午10:22:29
 */
@Table("RULE_MODEL_FACT")
public class RuleModel extends BaseEntity{
	
	private static final long serialVersionUID = 1L;
	
	@Id(keyType = KeyType.Auto)
	private String id;
	
	private String name;
	
	/**
	 * 规则模型id
	 */
	private String ruleModelId;
	
	/**
	 * java类名
	 */
	private String pkgName;
	
	/**
	 * 参数类别
	 */
	private String modelType;
	
	/**
	 * 参数标题（中文名）
	 */
	private String modelTitle;
	
	/**
	 * 参数数据类型
	 */
//	@NotNull(message = "参数数据类型不能为null")
	private String dataType;
	
	/**
	 * 变量英文标识key
	 */
	@NotNull(message = "参数唯一标识不能为null")
	private String modelIdentify;
	
	/**
	 * 参数可见性 0：公共；1私有
	 */
//	@NotNull(message = "参数适用范围不能为null")
	private String modelScopeType;
	
	/**
	 * 节点ID
	 */
	private String nodeId;
	
	/**
	 * 节点关联关系表ID
	 */
	@Column(ignore = true)
	private String ruleModelNodeMergeId;
	
	/**
	 * 是否是参数列表添加 1 是 ；0 不是
	 */
	@Column("IS_NODE_PARAM")
	private String isNodeParam;
	
	/**
	 * sql数据源ID
	 */
	@Column("SQL_DATASOURCE_ID")
	private String sqlDataSourceId;
	
	/**
	 * sql参数类型，0:基础参数；1:sql参数 2指标参数
	 */
	@Column("MODEL_CATEGORY")
	private String modelCategory;
	
	/**
	 * sql语句
	 */
	@Column("SQLEXP")
	private String sqlexp;
	
	/**
	 * sql参数
	 */
	@Column("SQL_PARAM")
	private String sqlParam;
	
	@Column(ignore = true)
	private List<InParameter> param;
	
	public static class InParameter {
		/**
		 * 键
		 */
		@NotNull(message = "参数键不能为空")
        private String key;
        /**
         * 类型
         */
        @NotNull(message = "参数类型不能为空")
        private String type;
        /**
         * 键中文描述
         */
        private String label;
        /**
         * 值
         */
        private Object value = "";
		public String getKey() {
			return key;
		}
		public void setKey(String key) {
			this.key = key;
		}
		public String getType() {
			return type;
		}
		public void setType(String type) {
			this.type = type;
		}
		public String getLabel() {
			return label;
		}
		public void setLabel(String label) {
			this.label = label;
		}
		public Object getValue() {
			return value;
		}
		public void setValue(Object value) {
			this.value = value;
		}

    }
	
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getRuleModelId() {
		return ruleModelId;
	}

	public void setRuleModelId(String ruleModelId) {
		this.ruleModelId = ruleModelId;
	}

	public String getPkgName() {
		return pkgName;
	}

	public void setPkgName(String pkgName) {
		this.pkgName = pkgName;
	}

	public String getModelType() {
		return modelType;
	}

	public void setModelType(String modelType) {
		this.modelType = modelType;
	}

	public String getModelTitle() {
		return modelTitle;
	}

	public void setModelTitle(String modelTitle) {
		this.modelTitle = modelTitle;
	}

	public String getDataType() {
		return dataType;
	}

	public void setDataType(String dataType) {
		this.dataType = dataType;
	}

	public String getModelIdentify() {
		return modelIdentify;
	}

	public void setModelIdentify(String modelIdentify) {
		this.modelIdentify = modelIdentify;
	}

	public String getModelScopeType() {
		return modelScopeType;
	}

	public void setModelScopeType(String modelScopeType) {
		this.modelScopeType = modelScopeType;
	}

	public String getNodeId() {
		return nodeId;
	}

	public void setNodeId(String nodeId) {
		this.nodeId = nodeId;
	}

	public String getRuleModelNodeMergeId() {
		return ruleModelNodeMergeId;
	}

	public void setRuleModelNodeMergeId(String ruleModelNodeMergeId) {
		this.ruleModelNodeMergeId = ruleModelNodeMergeId;
	}

	public String getIsNodeParam() {
		return isNodeParam;
	}

	public void setIsNodeParam(String isNodeParam) {
		this.isNodeParam = isNodeParam;
	}

	public String getSqlDataSourceId() {
		return sqlDataSourceId;
	}

	public void setSqlDataSourceId(String sqlDataSourceId) {
		this.sqlDataSourceId = sqlDataSourceId;
	}

	public String getModelCategory() {
		return modelCategory;
	}

	public void setModelCategory(String modelCategory) {
		this.modelCategory = modelCategory;
	}

	public String getSqlexp() {
		return sqlexp;
	}

	public void setSqlexp(String sqlexp) {
		this.sqlexp = sqlexp;
	}

	public String getSqlParam() {
		return sqlParam;
	}

	public void setSqlParam(String sqlParam) {
		this.sqlParam = sqlParam;
	}

	public List<InParameter> getParam() {
		return param;
	}

	public void setParam(List<InParameter> param) {
		this.param = param;
	}
	
}